﻿using ProjectBase.Core;
using ProjectBase.Core.Publishing;
using ProjectBase.Core.Publishing.Configuration;

namespace $safeprojectname$.Infrastructure.Factories
{
    public static class ProviderFactory
    {
        #region GetProviders
        public static IPublishingProvider NullProvider()
        {
            var config = PublishingConfigurationFactory.GetNullProvider();
            return new PublishingConfigurator().CreateProvider(config);
        }
        public static IPublishingProvider DefaultProvider()
        {
            var config = PublishingConfigurationFactory.GetDefaultProvider();
            return new PublishingConfigurator().CreateProvider(config);
        }
        public static IPublishingProvider ProviderLog4NetOnly()
        {
            var config = PublishingConfigurationFactory.GetProviderWithLog4NetOnly();
            return new PublishingConfigurator().CreateProvider(config);
        }
        public static IPublishingProvider ProviderExceptionOnly()
        {
            var config = PublishingConfigurationFactory.GetProviderWithExceptionOnly();
            return new PublishingConfigurator().CreateProvider(config);
        }
        public static IPublishingProvider ProviderExceptionWithMissingHandlerSettings()
        {
            var config = PublishingConfigurationFactory.GetProviderWithExceptionWithMissingHandlerSettings();
            return new PublishingConfigurator().CreateProvider(config);
        }
        public static IPublishingProvider ProviderExceptionWrongConfigPath()
        {
            var config = PublishingConfigurationFactory.GetProviderWithExceptionWrongConfigPath();
            return new PublishingConfigurator().CreateProvider(config);
        }
        public static IPublishingProvider WithMissingProvider()
        {
            var config = PublishingConfigurationFactory.GetMissingProvider();
            return new PublishingConfigurator().CreateProvider(config);
        }
        public static IPublishingProvider WithWrongProviderType()
        {
            var config = PublishingConfigurationFactory.GetWrongProviderType();
            return new PublishingConfigurator().CreateProvider(config);
        }
        public static IPublishingProvider WithMissingHandler()
        {
            var config = PublishingConfigurationFactory.GetMissingHandler();
            return new PublishingConfigurator().CreateProvider(config);
        }
        public static IPublishingProvider WithIncorrectHandler()
        {
            var config = PublishingConfigurationFactory.GetIncorrectHandler();
            return new PublishingConfigurator().CreateProvider(config);
        }
        public static IPublishingProvider BrokenProvider()
        {
            var config = PublishingConfigurationFactory.GetBrokenProvider();
            return new PublishingConfigurator().CreateProvider(config);
        }
        public static IPublishingProvider WithBrokenHandler()
        {
            var config = PublishingConfigurationFactory.GetBrokenHandler();
            return new PublishingConfigurator().CreateProvider(config);
        }
        public static IPublishingProvider ProviderWithMessageHandler()
        {
            var config = PublishingConfigurationFactory.GetProviderWithMessageHandler();
            return new PublishingConfigurator().CreateProvider(config);
        }
        public static IPublishingProvider ProviderWithNullConfig()
        {
            return new PublishingConfigurator().CreateProvider(null);
        }
        public static IPublishingProvider ProviderByAppConfig()
        {
            return new PublishingConfigurator().CreateProvider();
        }
        public static IPublishingProvider ProviderTypeBroken()
        {
            var config = PublishingConfigurationFactory.GetProviderTypeBrokenSettings();
            return new PublishingConfigurator().CreateProvider(config);
        }

        #endregion GetProviders
    }
}
